/**
 * 
 */
package com.pmsco.pms.util;

import com.pmsco.pms.core.constant.PmsConstant;

/**
 * @author Long Tran
 *
 */
public enum PmsUserRole {
	NORMAL_USER(PmsConstant.UserRole),
	ADMIN_USER(PmsConstant.AdminRole);
	
	private String role;
	
	PmsUserRole(String role) {
		this.role = role;
	}
	
	public String getRole() {
		return this.role;
	}
	
	public static PmsUserRole getPmsUserRole(String role) {
		PmsUserRole ret = null;
		for(PmsUserRole pmsUserRole : PmsUserRole.values()) {
			if(pmsUserRole.getRole().equals(role)) {
				ret = pmsUserRole;
				break;
			}
		}
		return ret;
	}
}
